
import { request } from "@/utils/http"

// 获取文章详情信息
const getArticleDetail = (id) => {
    return request({
        url:'/user/articleDetail',
        method:'GET',
        params:{id}
    })
}

// 添加文章信息
const addArticle = (data) => {
    return request({
        url:'/api/article',
        method:'POST',
        data
    })
}

const getMyArticleDetial = (id) => {
    return request({
        url:`/api/article/${id}`,
        method:'GET',
    })
}
const updateArticle = (data) => {
    return request({
        url:'/api/article',
        method:'PUT',
        data
    })
}

const getLikeCollect = (params) => {
    return request({
        url:`/api/likeCollect`,
        method:'get',
        params
    })
}

const addLike = (params) => {
    return request({
        url:`/api/like`,
        method:'get',
        params
    })
}

const addCollect = (params) => {
    return request({
        url:`/api/collect`,
        method:'get',
        params
    })
}
export {
    getArticleDetail,addArticle,getMyArticleDetial,updateArticle,getLikeCollect,addLike,addCollect,
}